{**
 * Prescription General Lookup
 *
 * @package   OpenEMR
 * @link      http://www.open-emr.org
 * @author    Brady Miller <brady.g.miller@gmail.com>
 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
 * @license   https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
 *}
<html>
<head>

{headerShow}

<link rel="stylesheet" href="{$GLOBALS.css_header}" type="text/css">
<script language="Javascript">
{literal}
		function my_process () {
			// Pass the variable
{/literal}
			parent.iframetopardiv(document.lookup.drug.value);
			parent.opener.document.prescribe.drug.value = document.lookup.drug.value;
			// Close the window
			window.self.close();
{literal}
		}
{/literal}
</script>
{literal}
 <style type="text/css" title="mystyles" media="all">
<!--
td {
	font-size:8pt;
	font-family:helvetica;
}
input {
	font-size:8pt;
	font-family:helvetica;
}
select {
	font-size:8pt;
	font-family:helvetica;
}
a {
	font-size:8pt;
	font-family:helvetica;
}
textarea {
	font-size:8pt;
	font-family:helvetica;
}
-->
</style>
{/literal}
</head>
<body onload="javascript:document.lookup.drug.focus();">
<div style="" class="drug_lookup" id="newlistitem">
	<form NAME="lookup" ACTION="{$FORM_ACTION}" METHOD="POST" onsubmit="return top.restoreSession()" style="margin:0px">

	{if $drug_options}
        <div>
        {html_options name="drug" values=$drug_values options=$drug_options}<br/>
        </div>
        <div>
            <a href="javascript:;" onClick="my_process(); return true;">{xl t='Select'|escape:'html'}</a> |
            <a href="javascript:;" class="button" onClick="parent.cancelParlookup();">{xl t='Cancel'|escape:'html'}</a> |
            <a href="{$CONTROLLER_THIS}" onclick="top.restoreSession()">{xl t='New Search'|escape:'html'}</a>
        </div>
	{else}
		{$NO_RESULTS}

		<input TYPE="HIDDEN" NAME="varname" VALUE=""/>
		<input TYPE="HIDDEN" NAME="formname" VALUE=""/>
		<input TYPE="HIDDEN" NAME="submitname" VALUE=""/>
		<input TYPE="HIDDEN" NAME="action" VALUE="{xl t='Search'|escape:'html'}">
		<div ALIGN="CENTER" CLASS="infobox">
			<input TYPE="TEXT" NAME="drug" VALUE="{$drug|escape:'html'}"/>
			<input TYPE="SUBMIT" NAME="action" VALUE="{xl t='Search'|escape:'html'}" class="button"/>
			<input TYPE="BUTTON" VALUE="{xl t='Cancel'|escape:'html'}" class="button" onClick="parent.cancelParlookup();"/>
		</div>
		<input type="hidden" name="process" value="{$PROCESS|escape:'html'}" />

	{/if}</form>
	</div>
</body>
</html>
